﻿namespace System.Web.Mvc
{
	public static partial class Holovacs
	{
		public static int ToIntOrZero(this object target)
		{
			if (target == null) return 0;
			int val;
			if (int.TryParse(target.ToString(), out val))
			{
				return val;
			}
			return 0;
		}
	}
}